#include "drv_led.h"
#include "drv_beep.h"
#include "drv_key.h"
#include "drv_usart.h"
#include "drv_exti.h"
#include "string.h"
#include "drv_time.h"
#include "drv_iic.h"
#include "oled.h"
#include "bmp.h"
#include "drv_dma.h"


uint8_t key_flag1 = 1;
uint8_t key_flag2 = 2;
uint8_t key_flag3 = 3;
uint8_t key_flag4 = 4;

int main()
{
	drv_systick_init(168);
	drv_usart2_init();

	usart_sendstr(USART2, "AT+RESTORE\r\n",strlen("AT+RESTORE\r\n"));
	drv_systick_delayms(2000);
	
	usart_sendstr(USART2, "AT\r\n",strlen("AT\r\n"));
	drv_systick_delayms(500);
	
	usart_sendstr(USART2, "AT+CWMODE_CUR=1\r\n",strlen("AT+CWMODE_CUR=1\r\n"));
	drv_systick_delayms(500);
	
	usart_sendstr(USART2, "AT+CIPMUX=0\r\n",strlen("AT+CIPMUX=0\r\n"));
	drv_systick_delayms(500);
	
	usart_sendstr(USART2, "AT+CWJAP_CUR=\"hqyjcs\",\"hqyj2022\"\r\n",strlen("AT+CWJAP_CUR=\"hqyjcs\",\"hqyj2022\"\r\n"));
	drv_systick_delayms(7000);
	
	usart_sendstr(USART2, "AT+CIPSTART=\"TCP\",\"192.168.43.128\",9000\r\n",strlen("AT+CIPSTART=\"TCP\",\"192.168.43.128\",9000\r\n"));
	drv_systick_delayms(2000);
	
	usart_sendstr(USART2, "AT+CIPSEND=24\r\n",strlen("AT+CIPSEND=24\r\n"));
	drv_systick_delayms(500);
	
	//usart_sendstr(USART2, "AT+RESTORE\r\n",strlen("AT+RESTORE\r\n"));

}

